<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>修改密码</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link rel="stylesheet" type="text/css" href="images/main.css">

<script type="text/javascript" src="images/jquery.js"></script>
<script type="text/javascript" src="images/jquery.md5.js"></script>
<script type="text/javascript">
	$(function() {
		$("#submit").click(
				function() {
					$("#oldPwd").css("border", "1px solid #BDC8C4");
					$("#newPwd").css("border", "1px solid #BDC8C4");
					$("#conPwd").css("border", "1px solid #BDC8C4");
					if ($("#oldPwd").val() == "") {
						$("#oldPwd").css("border", "1px solid red");
						$("#oldPwd").focus();
						return false;
					} else if ($("#newPwd").val() == "") {
						$("#newPwd").css("border", "1px solid red");
						$("#newPwd").focus();
						return false;
					} else if ($("#conPwd").val() == ""
							|| $("#conPwd").val() != $("#newPwd").val()) {
						$("#conPwd").css("border", "1px solid red");
						$("#conPwd").focus();
						return false;
					} else {
						$("#oldPwd").css("border", "1px solid #BDC8C4");
						$("#newPwd").css("border", "1px solid #BDC8C4");
						$("#conPwd").css("border", "1px solid #BDC8C4");
						$("#oldPwd").attr("value", $.md5($("#oldPwd").val()));
						$("#newPwd").attr("value", $.md5($("#newPwd").val()));
						$("#conPwd").attr("value", $.md5($("#conPwd").val()));
						return true;
					}
				});
	});
</script>

</head>

<body>
	<div class="mainBox">
		<form action="changePwd" method="post">
			<input type="hidden" name="option" value="change" /> 
			<table class="table_style" cellpadding="3" cellspacing="1" border="0">
				<tr>
					<td colspan="2" id="msg" class="td_style"><s:property
							value="#session.SESSION_MSG" /></td>
				</tr>
				<tr>
					<td class="td_style1">原密码:&nbsp;</td>
					<td class="td_style"><input type="password" id="oldPwd" name="oldPwd"
						class="text" /></td>
				</tr>
				<tr>
					<td class="td_style2">新密码:&nbsp;</td>
					<td class="td_style"><input type="password" id="newPwd" name="newPwd"
						class="text" /></td>
				</tr>
				<tr>
					<td class="td_style1">确认密码:&nbsp;</td>
					<td class="td_style"><input type="password" id="conPwd" class="text" /></td>
				</tr>
				<tr>
					<td class="td_style"></td>
					<td class="td_style">&nbsp;<input type="submit" value="确认修改" class="buttons"
						id="submit" /><input type="reset" value="重新输入" class="buttons"
						style="margin-left:50px" /></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>
